package cn.azzhu.day03;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author azzhu
 * @create 2020-09-18 11:34:03
 */
public class PrintSink {
    public static void main(String[] args) throws Exception {
        final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        final DataStreamSource<String> lines = env.socketTextStream("hadoop105", 9999);

        //print:并行的sink
        //lines.print();
        lines.print("res").setParallelism(2);

        env.execute("PrintSink");
    }
}
